/*-------------------------------------------------------------------------
***************** Modification History ***********************************
   @doc
   @module date.h - Header file for Date entry and validation functions |
   @end
   
$Log: /SoftPay/SPK2SIM/Source/Include/date.h $ 
 * 
 * 3     2/21/00 2:59p Jim_b4
 * Include file restructuring
 * 
 * 2     10/20/99 10:39a Kevin_v1
 * Implemented IDLE_LOOP_OPERATION
 * 
 * 1     7/19/99 5:45p Jim_b4
 * 
 * 1     7/19/99 4:31p Jim_b4
 * 
 * 2     6/09/99 11:22a Monique_b1
 * Change headers and file names for SP 2000
**************************************************************************

   Copyright (C) 1999 by VeriFone, Inc.

   All rights reserved.  No part of this software may be reproduced,
   transmitted, transcribed, stored in a retrieval system, or translated
   into any language or computer language, in any form or by any means,
   electronic, mechanical, magnetic, optical, chemical, manual or otherwise,
   without the prior written permission of VeriFone, Inc.

---------------------------------------------------------------------------*/


#ifndef VSDATE_H
#define VSDATE_H

#include <transact.h>

#define DDMMYY 		0x0001
#define MMDDYY 		0x0002
#define MMYY   		0x0004
#define YYMM   		0x0008
#define YYMMDD 		0x0010
#define YYYYMMDD 	0x0020

#define INDEX_TO_TIME  8   /* With respect to the format YYYYMMDDHHMMSSD */
#define INDEX_TO_DAY   6   /* "" */
#define INDEX_TO_WDAY 14   /* "" */

#define LAST_YEAR_OF_TWENTIETH_CENTURY 99
#define MIDPOINT_OF_TWENTIETH_CENTURY  50
#define TWENTIETH_CENTURY   "19"
#define TWENTYFIRST_CENTURY "20"
#define MAX_MONTHS_IN_YEAR 12
#define MIN_MONTHS_IN_YEAR 1

#ifndef VSDATE_C
extern int inValidateOrigDate (char *szDateEntered);
#endif

/* Function Prototypes */
#ifdef VSDATE_C
void vdGetCentury (char *szYear, char *szCentury);
int inFormatCompleteDateAndTime (char *szCompleteDateAndTime,char *szDateEntered, int inMode);
void vdDelay (int inMilliSec);
void vdGetTime (char *pchTime);
void vdGetDate (char *pchDate, int inMode);
int inIsDateInRange (char *date_entered, int min_val, int max_val, int date_mode);
int inValidateExpDate (char *szDateEntered);
int inValidateOrigDate (char *szDateEntered);
int inValChTime(TRANSACTION_OBJECT *pobTran, char *pchTime, int inTimeLen);
int inVal8ChDate(TRANSACTION_OBJECT *pobTran, char *pchDate, int inDateLen);
int inEnterSysChron(TRANSACTION_OBJECT *pobTran, int inOpCode);
int inPackDateTime(char *pchDate, char *pchTime);
int	inHourlyNotify (TRANSACTION_OBJECT *pobTran);
#else
extern void vdGetCentury (char *szYear, char *szCentury);
extern int inFormatCompleteDateAndTime (char *szCompleteDateAndTime,char *szDateEntered, int inMode);
extern void vdDelay (int inMilliSec);
extern void vdGetTime (char *pchTime);
extern void vdGetDate (char *pchDate, int inMode);
extern int inIsDateInRange (char *date_entered, int min_val, int max_val, int date_mode);
extern int inValidateExpDate (char *szDateEntered);
extern int inValChTime(void *pobTran, char *pchTime, int inTimeLen);
extern int inVal8ChDate(void *pobTran, char *pchDate, int inDateLen);
extern int inEnterSysChron(void *pobTran, int inOpCode);
extern int inPackDateTime(char *pchDate, char *pchTime);
extern int inValidateOrigDate (char *szDateEntered);
extern int inHourlyNotify (TRANSACTION_OBJECT *pobTran);
#endif

#endif

